package org.test.client.forcedirect;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Stroke;

import org.test.client.ui.util.UIUtil;

public class FDEdge {

	private FDNode srcNode;
	private FDNode dstNode;
	
	private int lineWidth = 1;
	private Color color = Color.GREEN;
	
	public void renderEdge(Graphics2D g2d){
		Stroke oldStroke = g2d.getStroke();
		
		Stroke stroke = UIUtil.getStroke(lineWidth);
		g2d.setStroke(stroke);
		g2d.setColor(color);
		g2d.drawLine(srcNode.getX(), srcNode.getY(), dstNode.getX(), dstNode.getY());
		
		g2d.setStroke(oldStroke);
	}

	
	public FDNode getSrcNode() {
		return srcNode;
	}

	public void setSrcNode(FDNode srcNode) {
		this.srcNode = srcNode;
	}

	public FDNode getDstNode() {
		return dstNode;
	}

	public void setDstNode(FDNode dstNode) {
		this.dstNode = dstNode;
	}

	public int getLineWidth() {
		return lineWidth;
	}

	public void setLineWidth(int lineWidth) {
		this.lineWidth = lineWidth;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}
	
	
}
